﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using CommonHelper.Server.CommonApi;
using CommonHelper.Utility;

namespace WeiXinGeneralApi.Controllers
{
    public class JSSDKController : Controller
    {
        private static string _appId = ConfigurationManager.AppSettings["AppId"];
        private static string _appSecret = ConfigurationManager.AppSettings["AppSecret"];
        //
        // GET: /JSSDK/

        public ActionResult Index()
        {

            var jsSdk = new JSSDKHelper();
            var timestamp = JSSDKHelper.GetTimestamp();
            var nonceStr = JSSDKHelper.GetNoncestr();
            var appId = _appId;
            var appSecret = _appSecret;
            //var jsTicket = JsApiTicketContainer.TryGetTicket(appId, appSecret);

            ViewBag.AppID = appId;
            //ViewBag.AppSecret = appSecret;
            ViewBag.timestamp = timestamp;
            ViewBag.nonceStr = nonceStr;
            //ViewBag.signature = jsSdk.GetSignature(jsTicket, nonceStr, timestamp, Request.Url.AbsoluteUri);

            return View();
        }

    }
}
